package com.kgc.scd.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.kgc.scd.bean.ShopAttribute;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created On : 2022/11/23.
 * <p>
 * Author : 刘慧枫
 * <p>
 * Description: ShopAttributeMapper
 */
public interface ShopAttributeMapper extends BaseMapper<ShopAttribute> {

    @Select("SELECT a.`name`,b.`value`\n" +
            "FROM shop_attribute a,(SELECT attribute_id,`value` FROM shop_goods_attribute WHERE goods_id = #{goodsId}) b\n" +
            "WHERE a.id = b.attribute_id;")
    List<ShopAttribute> selectShopAttribute(@Param("goodsId") String goodsId);

}
